import {
  Create,
  DelById,
  Update,
  GetList,
  GetEditById,
  CustomApi,
} from "./baseApi";

/**
#region 部门
 */
export const GetDepartmentList = (params) =>
  GetList("CoreCmsDepartment", params);

export const DelDepartmentById = (id) => DelById("CoreCmsDepartment", id);

export const AddDepartment = (params) => Create("CoreCmsDepartment", params);

export const GetDepartmentById = (id) => GetEditById("CoreCmsDepartment", id);

export const EditDepartment = (params) => Update("CoreCmsDepartment", params);

/**
#region 员工
*/
export const GetEmployeeList = (params) => GetList("CoreCmsEmployee", params);

export const DelEmployeeById = (id) => DelById("CoreCmsEmployee", id);

export const AddEmployee = (params) => Create("CoreCmsEmployee", params);

export const GetEmployeeById = (id) => GetEditById("CoreCmsEmployee", id);

export const EditEmployee = (params) => Update("CoreCmsEmployee", params);

/**
#region 关联门店
*/
export const GetStoreOrganizationList = (params) =>
  GetList("CoreCmsStoreOrganization", params);

export const DelStoreOrganizationById = (id) =>
  DelById("CoreCmsStoreOrganization", id);

export const AddStoreOrganization = (params) =>
  Create("CoreCmsStoreOrganization", params);

export const GetStoreOrganizationById = (id) =>
  GetEditById("CoreCmsStoreOrganization", id);

export const EditStoreOrganization = (params) =>
  Update("CoreCmsStoreOrganization", params);

export const GetStoreList = (params) =>
  CustomApi("CoreCmsStoreOrganization", "GetStoreList", params, false);

export const DoBatchCreateStore = (params) =>
  CustomApi("CoreCmsStoreOrganization", "DoBatchCreate", params, true);

/**
#region 
*/
export const GetSysOrganizationList = (params) =>
  GetList("SysOrganization", params);

// 删除
export const DelSysOrganizationById = (id) => DelById("SysOrganization", id);

// 新增
export const AddSysOrganization = (params) => Create("SysOrganization", params);

// 获取单条
export const GetSysOrganizationById = (id) =>
  GetEditById("SysOrganization", id);

// 编辑
export const EditSysOrganization = (params) =>
  Update("SysOrganization", params);

/**
#region 
*/
export const GetSalesPromotionList = (params) =>
  GetList("corecmssalespromotion", params);

// 删除
export const DelSalesPromotionById = (id) =>
  DelById("corecmssalespromotion", id);

// 新增
export const AddSalesPromotion = (params) =>
  Create("corecmssalespromotion", params);

// 获取单条
export const GetSalesPromotionById = (id) =>
  GetEditById("corecmssalespromotion", id);

// 编辑
export const EditSalesPromotion = (params) =>
  Update("corecmssalespromotion", params);
